package com.sun.services.roles.impls;

import com.sun.commons.base.BaseService;
import com.sun.dto.users.PermissionDto;
import com.sun.services.roles.repository.PermissionRepository;
import com.sun.services.roles.service.PermissionService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@AllArgsConstructor
public class PermissionServiceImpl extends BaseService implements PermissionService {
    private final PermissionRepository repository;

    @Override
    public List<PermissionDto> findAllByRoleId(Long roleId) {
        return repository.findAllByRoleId(roleId);
    }
}
